<template>
	<el-dialog class="dialog" :title="dialogTitle" :visible.sync="showCheckPassWin" width="480px" :lock-scroll="false" :before-close="handleCheckPassWinClose">
		<!-- <div style="text-align: right;">
      <el-button style="text-align: right;" type="text" size="medium" @click="checkAll">一键全部确认</el-button>
    </div> -->
		<el-form :model="checkForm" ref="checkForm" label-width="220px" size="small" label-suffix=": ">
			<template v-if="checkType == 'put'">
				<el-form-item prop="equipmentLabels" label="设备标签是否合规">
					<span :style="{ color: checkForm.equipmentLabels == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.equipmentLabels == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="powerLineLabels" label="电源线标签是否合规">
					<span :style="{ color: checkForm.powerLineLabels == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.powerLineLabels == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="netLineLabels" label="网线标签是否合规">
					<span :style="{ color: checkForm.netLineLabels == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.netLineLabels == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="opticalFiberLabels" label="光纤标签是否合规">
					<span :style="{ color: checkForm.opticalFiberLabels == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.opticalFiberLabels == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="equipmentGround" label="设备是否接地">
					<span :style="{ color: checkForm.equipmentGround == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.equipmentGround == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="plugging" label="空闲端口是否物理封堵">
					<span :style="{ color: checkForm.plugging == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.plugging == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="probe" label="探针是否配置">
					<span :style="{ color: checkForm.probe == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.probe == '1' ? '是' : '否' }}</span>
				</el-form-item>
			</template>
			<template v-if="checkType == 'out'">
				<el-form-item prop="powerLineClear" label="机柜内废弃电源线是否清理">
					<span :style="{ color: checkForm.powerLineClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.powerLineClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="netLineClear" label="废弃网线是否清理">
					<span :style="{ color: checkForm.netLineClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.netLineClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="garbageClear" label="垃圾是否清理">
					<span :style="{ color: checkForm.garbageClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.garbageClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="oldLabelsClear" label="资产原标签是否已撕掉">
					<span :style="{ color: checkForm.oldLabelsClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.oldLabelsClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="inStorage" label="资产是否放入库房">
					<span :style="{ color: checkForm.inStorage == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.inStorage == '1' ? '是' : '否' }}</span>
				</el-form-item>
			</template>
			<template v-if="checkType == 'scrap'">
				<el-form-item prop="powerLineClear" label="机柜内废弃电源线是否清理">
					<span :style="{ color: checkForm.powerLineClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.powerLineClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="netLineClear" label="废弃网线是否清理">
					<span :style="{ color: checkForm.netLineClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.netLineClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="garbageClear" label="垃圾是否清理">
					<span :style="{ color: checkForm.garbageClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.garbageClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<el-form-item prop="oldLabelsClear" label="资产原标签是否已撕掉">
					<span :style="{ color: checkForm.oldLabelsClear == '1' ? '#21B795' : '#EA305C' }">{{ checkForm.oldLabelsClear == '1' ? '是' : '否' }}</span>
				</el-form-item>
				<!-- <el-form-item prop="inStorage" label="资产是否放入库房">
          <span :style="{ color: checkForm.inStorage == '1' ? '#21B795' : '#EA305C' }">{{
            checkForm.inStorage == '1' ? '是' : '否' }}</span>
        </el-form-item> -->
			</template>
			<el-form-item prop="notes" label="备注" label-width="60px">
				<el-input type="textarea" disabled v-model="checkForm.notes" :autosize="{ minRows: 3 }" maxlength="200" show-word-limit></el-input>
			</el-form-item>
		</el-form>
		<!-- <div slot="footer" class="dialog-footer">
      <el-button size="small" @click="checkBack">验收驳回</el-button>
      <el-button size="small" type="primary" @click="onSubmitCheckPass">验收通过</el-button>
    </div> -->
	</el-dialog>
</template>

<script>
	import assetPutawayApi from '@/api/assetPutawayApi'
	import assetOutApi from '@/api/assetOutApi'
	export default {
		name: 'CheckPassWin',
		props: {
			showWin: {
				type: Boolean,
				default: false,
			},
			checkType: {
				type: String,
				default: 'put', // pass: 上架，out: 下架
			},
			dialogTitle: '',
			checkForm: {
				type: Object,
				default: () => {
					return {}
				},
			},
		},
		watch: {
			showWin(newVal, oldVal) {
				this.showCheckPassWin = newVal
			},
		},
		data() {
			return {
				showCheckPassWin: false,
				// checkForm: {
				//   managementId: '', // 申请单ID
				//   dualNetworkAccess: '', // 是否双网接入
				//   equipmentGround: false, // 设备是否接地
				//   equipmentLabels: false, //设备标签是否合规
				//   garbageClear: false, //垃圾是否清理
				//   inStorage: false, //资产是否放入库房
				//   netLineClear: false, //废弃网线是否清理
				//   netLineLabels: false, //网线标签是否合规
				//   notes: '', //验收备注
				//   oldLabelsClear: false, //资产原标签是否已撕掉
				//   opticalFiberLabels: false, //光纤标签是否合规
				//   plugging: false, //空闲端口是否物理封堵
				//   powerLineClear: false, //机柜内废弃电源线是否清理
				//   powerLineLabels: false, //电源线标签是否合规
				//   probe: false, //探针是否配置
				//   pullOut: false, //资产是否已从机房/库房撤走
				// },
			}
		},
		methods: {
			handleCheckPassWinClose() {
				this.$emit('update:showWin', false)
			},
		},
	}
</script>
<style lang="scss" scoped>
	.dialog {
		/deep/.el-dialog__body {
			padding: 0 20px 30px 20px;
		}

		/deep/.el-dialog__footer {
			padding: 0 !important;
		}
	}

	.dialog-footer {
		border-top: 1px solid #f0f0f0;
		display: flex;
		justify-content: flex-end;
		padding: 10px 15px;
	}
</style>
